<?php
    session_start();
    if (isset($_SESSION['user']))
    {
        header('location: profile.php');
    }
?>
<!doctype html>
<html lang="en">
<head>
<link>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Авторизация и регистрация</title>
    <link rel="stylesheet" href="/assets/css/style.css">
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background-color: cornflowerblue;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: "Franklin Gothic Book",sans-serif;
        }

        form{

            color: white;
            display: flex;
            flex-direction: column;


        }
        input {
            margin:10px 0;
            padding: 10px;
            border: unset;
            border-bottom: 2px solid #e3e3e3;
            outline: none;
        }

        button{
            padding: 10px;
            border: unset;
            background-color: #e3e3e3;
            cursor: pointer;
        }

        a {
            color: aqua;
            font-weight: bold;
            text-decoration: none;

        }

        p{
            margin: 10px 0;
        }
        div {

        }
        .msg {
            border: 2px solid #ffa908;
            border-radius: 5px;
            padding: 10px;
            text-align: center;
            font-weight: bold;

        }
    </style>
</head>
<body>
<div>
<form action="vendor/signin.php" method="post">
    <p align="center">Вход</p>
    <label>Логин</label>
    <input type="text" name="login" placeholder="Введите свой логин">
    <label>Пароль</label>
    <input type="password" name="password" placeholder="Введите свой пароль">
    <button type="submit">Войти</button>
    <p>
        У Вас нет аккаунта? - <a href="registr.php">зарегистрируйтесь</a>
    </p>

    <?php
    if (isset($_SESSION['message']))
    {
        echo '<p class="msg">' . $_SESSION['message'] . '</p>';
    }
    unset($_SESSION['message']);
    ?>
</form>
</div>
</body>
</html>
